package com.gonsin.ta.logic.db;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;

/**
 * 流程实例
 */
@ApiModel("信号表")
@Data
@Table(name = "ta_chain_signal", indexes = {
        @Index(columnList = "instance_id, gs_signal")
})
@Entity
public class SignalBean {

    @Id
    @ApiModelProperty("主键")
    @Column(name = "signal_id", columnDefinition = "varchar(32) comment '主键'")
    private String signalId;

    @ApiModelProperty("流程id")
    @Column(name = "instance_id", columnDefinition = "varchar(32) comment '主键'")
    private String instanceId;


    @ApiModelProperty("信号")
    @Column(name = "gs_signal", columnDefinition = "varchar(64) comment '信号值'")
    private String signal;


    @ApiModelProperty("超时时间")
    @Column(name = "timeout", columnDefinition = "bigint(11) comment '超时时间'")
    private Long timeout;


    @ApiModelProperty("创建时间")
    @Column(name = "insert_time", columnDefinition = "bigint(11) comment '创建时间'")
    private long insertTime;


    @ApiModelProperty("触发信号时执行的节点")
    @Column(name = "next", columnDefinition = "text comment '触发信号时执行的节点'")
    private String next;


    @ApiModelProperty("超时时触发的节点")
    @Column(name = "timeout_task", columnDefinition = "text comment '超时时触发的节点'")
    private String timeoutTask;


    @ApiModelProperty("嵌套调用的节点")
    @Column(name = "stack", columnDefinition = "text comment '嵌套调用的节点'")
    private String stack;


    @ApiModelProperty("触发信号时的环境变量")
    @Column(name = "context", columnDefinition = "blob comment '触发信号时的环境变量'")
    private byte[] context;



}
